package com.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/user")
public class UserController {
    @RequestMapping("/detail")
    public String detail()
    {
        return "user_detail";
    }
    @RequestMapping("/login/{username}/{password}")
    public String login(@PathVariable String username,
                        @PathVariable String password) {
        System.out.println("username: " + username);
        System.out.println("password: " + password);
        return "ok";
    }
    @RequestMapping(value = "/login" ,method = RequestMethod.POST)
    public String login1() {

        return "ok";
    }
//    @RequestMapping(value = "/login1" ,params = {"username","password"})
//    @RequestMapping(value = "/login1" ,params = {"username=admin","password"})
    @RequestMapping(value = "/login1" ,params = {"!username","password"})
    public String login2() {

        return "ok";
    }

}
